<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>订单管理</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/backStyle.css">
<link rel="stylesheet" type="text/css" href="css/myButton.css">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap-modal.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>

<style>
html,body {
	height: 100%;
	width: 100%;
	border: 0;
	background: #fff;
	overflow-y: auto;
}
</style>
</head>

<body>
	<ul class="breadcrumb">
		<li><a href="sys/welcome.jsp">首页</a></li>
		<li class="active">订单管理</li>
	</ul>
	<div class="panel panel-default">
		<div class="panel-body">
			<table class="table table-striped">
				<thead>
					<tr>
						<th style="width: 17%;">订单号</th>
						<th style="width: 14%;">生成日期</th>
						<th style="width: 7%;">总金额</th>
						<th style="width: 20%;">状态</th>
						<th style="width: 10%;">买家</th>
						<th style="width: 10%;">收货人</th>
						<th style="width: 10%;">卖家</th>
						<th style="width: 12%;">操作</th>
					</tr>
				</thead>
				<tbody id="orderTable">
					<s:iterator value="Olist" var="orders">
						<tr>
							<td><s:property value="#orders.num"/></td>
							<td><s:date name="#orders.creDate" format="yyyy/MM/dd hh:mm:ss"/></td>
							<td><s:property value="#orders.money"/></td>
							<td><s:property value="#orders.status"/></td>
							<td><s:property value="#orders.user.name"/></td>
							<td><s:property value="#orders.receiver"/></td>
							<td>
								<s:iterator value="#orders.ordergoodses" var="ordergoods" status="i">
									<s:if test="#i.index<1">
										<s:property value="#ordergoods.goods.user.name" />
									</s:if>
								</s:iterator>
							</td>
							<td><a class="button blue medium" onclick="viewOrders('<s:property value="#orders.id"/>')">详情</a></td>
						</tr>
					</s:iterator>
				</tbody>
			</table>
		</div>
	</div>
</body>
<script type="text/javascript">
		function viewOrders(id){
			window.location.href = "<%=basePath%>ordersView.action?orders.id="+id;
		}
</script>
</html>